package cn.zhukelili.expand;

/**
 * @Description: 简化算法
 * @Auther: hongheshou
 * @Date: 2018/7/18 16:39
 */
public class Calculator2 {
    //加符号
    private final static String ADD_SYMBOL = "+";
    //减符号
    private final static String SUB_SYMBOL = "-";

    public int exec(int a, int b, String symbol) {
        return symbol.equals(ADD_SYMBOL) ? a + b : a - b;
    }
}
